import { defineStore } from "pinia";
import { ref, reactive } from "vue";

export const useCounterStore = defineStore({
    id: "counter",
    state: () => ({
        counter: 0,
    }),
    getters: {
        doubleCount: (state) => state.counter * 2,
    },
    actions: {
        increment() {
            this.counter++;
        },
    },
});
export const userIds = defineStore('userinfo', () => {
    let userinfo = reactive({
        user: {}
    })
    let changeInfo = (value) => {
        console.log(value);
        userinfo.user = value;
        console.log('1', userinfo.user)
    }
    return {
        userinfo,
        changeInfo,
    };
});

export const flagStore = defineStore("flag", () => {
    let flag = ref(true);
    let changeFlag = (value) => {
        flag.value = value;
    };

    return {
        flag,
        changeFlag,
    };
});
export const workjs = defineStore("workShow", () => {
    let workShow = ref(true);
    let changeShow = (value) => {
        workShow.value = value;

    };

    return {
        workShow,
        changeShow,
    };
});